<?php

class Config_File_Reader implements Config_Reader {

	protected $_directory = '';

	public function __construct($directory = 'config')
	{
		$this->_directory = trim($directory, '/');
	}

	public function load($group)
	{
		$config = array();

		if ($files = Core::find_file($this->_directory, $group, NULL, TRUE))
		{
			foreach ($files as $file)
			{
				$config = Arr::merge($config, Core::load($file));
			}
		}

		return $config;
	}

}
